home *** CD-ROM | disk | FTP | other *** search
- #include <SpeechRecognition.h>
- #include <AppleEvents.h>
-
- OSErr MyInstallSpeechAEHandlers (void);
-
-
- extern pascal OSErr MyHandleSpeechDetected (const AppleEvent *theAppleEvent,
- const AppleEvent * reply, long handlerRefcon);
- extern pascal OSErr MyHandleSpeechDone (const AppleEvent *theAppleEvent,
- const AppleEvent * reply, long handlerRefcon);
-
- OSErr MyInstallSpeechAEHandlers (void)
- {
- OSErr myErr = noErr;
-
- myErr = AEInstallEventHandler(kAESpeechSuite, kAESpeechDetected,
- NewAEEventHandlerProc(MyHandleSpeechDetected), 0, false);
-
- if (!myErr) myErr = AEInstallEventHandler(kAESpeechSuite, kAESpeechDone,
- NewAEEventHandlerProc(MyHandleSpeechDone), 0, false);
-
- return myErr;
- }